from django.db import models
from meiduo_mall.utils.models import BaseModel
# Create your models here.

from user.models import User


class QQAuthUser(BaseModel):
    """定义QQ模型类"""

    openid = models.CharField(verbose_name="qq用户唯一标识", db_index=True, max_length=64)
    # CASCADE 将外键设为级联
    user = models.ForeignKey(User, verbose_name="qq关联的用户", on_delete=models.CASCADE)

    class Meta:
        db_table = "tb_qq"
        verbose_name = "qq登录的用户信息"
        verbose_name_plural = verbose_name
